﻿<div id="headerBar" class="bigBox">
<div class="box">
欢迎访问 @WorkContext.MallConfig.MallName
<div  class="headerLink">
    @if (WorkContext.Uid < 1)
    {
        <a href="@Url.Action("login", "account", new RouteValueDictionary { { "returnUrl", WorkContext.Url } })">[登录]</a>
        <a href="@Url.Action("register", "account")" class="A_b">[注册]</a>
    }
    else
    {
        @:您好: @WorkContext.NickName
        <a href="@Url.Action("logout", "account")">[退出]</a>
        if (WorkContext.PartUserInfo.StoreId > 1)
        {
        <a href="@Url.Action("index", "home", new RouteValueDictionary { { "area", "storeadmin" } })">[店铺管理]</a>
        }
        if (WorkContext.MallAGid > 1)
        {
        <a href="@Url.Action("index", "home", new RouteValueDictionary { { "area", "malladmin" } })">[商城管理]</a>
        }
        <a href="@Url.Action("orderlist", "ucenter")">[我的订单]</a>
    }
</div>
</div> 
</div>

 @{
     List<AdvertInfo> homeTopAdvertList = Adverts.GetAdvertList(6);
     }
     @if (homeTopAdvertList != null && homeTopAdvertList.Count > 0)
     {
<div class="headerAD box">
    <a href="@homeTopAdvertList[0].Url"><img src="@{@WorkContext.ImageCDN}/upload/adv/@homeTopAdvertList[0].Image" width="1210" height="70" /></a>
    <a href="javascript:;" class="close" onclick="this.parentNode.style.display='none'">x</a>
</div>
     }

<div id="header" class="bigBox">
<div class="box" id="header1">
<a href="/" class="logo left"><img src="@{@WorkContext.ImageCDN}/images/logo.jpg" /></a>
<div class="search left">
<div class="searchCon">
    <input type="text" id="word" name="word" class="Stext" autocomplete="off" onkeydown="javascript:if(event.keyCode==13) mallSearch(document.getElementById('word').value);" value="@Html.Raw(WorkContext.SearchWord)" />
    <input name="" type="button" value="搜索" class="Sbutton" onclick="mallSearch(document.getElementById('word').value)" />
<div class="clear"></div>
</div>

<div class="searchHot">热门搜索：
 @{
     List<AdvertInfo> searchWordAdvertList = Adverts.GetAdvertList(5);
     }
    @foreach (AdvertInfo info in searchWordAdvertList){<a href="@info.Url">@info.Title</a> }
</div>

</div>

<div class="shopping right" id="cartSnapBox">
<h2><a href="@Url.Action("index", "cart")">我的购物车<b id="cartSnapProudctCount">@WorkContext.CartProductCount</b></a></h2>
<div id="cartSnap" class="shoppingList" style=" display:none;"><div class="loding"><img src="@{@WorkContext.ImageCDN}/images/loading.gif" /><br />加载中，请稍候... </div></div>
</div>
<script type="text/javascript">
    $("#cartSnapBox").mouseenter(function () {
        getCartSnap();
    })
    $("#cartSnapBox").mouseleave(function () {
        closeCartSnap();
    })
</script>

<div class="clear"></div>
</div>
</div>

<div id="nav" class="bigBox">
<div class="box">
<!-- 分类导航 -->

<div id="categorys">
<h2>全部商品分类</h2>

<div id="categorysCon" class="hide">

@{
    List<CategoryInfo> categoryList = Categories.GetCategoryList();
    }
@{
    int layerFlag = 0;
    foreach (CategoryInfo info in categoryList)
    {
        if (info.Layer == 1)
        {
            if (layerFlag == 1)
            {
               @:</div></div>
            }
            @:<div class="item" onmouseover="this.className='item hotItem'" onmouseout="this.className='item'"><h3><a href="javascript:void(0)">@info.Name</a></h3><div class="itmeSon">
            layerFlag = 1;
        }
        else if (info.Layer == 2)
        {
            @:<dl><dt><a style="" href="javascript:void(0)">@info.Name</a></dt><dd>
            foreach (CategoryInfo category in categoryList.FindAll(x => x.ParentId == info.CateId))
            {
                 @:<em><a style="" href="/list/@{@category.CateId}.html">@category.Name</a></em>
            }
            @:</dd><div class="clear"></div></dl>
        }
    }
    @:</div></div>
}

</div>

</div>
<script type="text/javascript">
    $("#categorys").mouseover(function () {
        $("#categorysCon").removeClass("hide");
    })
    $("#categorys").mouseout(function () {
        $("#categorysCon").addClass("hide");
    })
</script>
<!-- 分类导航结束 -->

<ul id="navItme">
    @foreach (NavInfo info in WorkContext.NavList)
    {
        <li><a href="@info.Url">@info.Name</a></li>
    }
</ul>
</div>
</div>